/**
 * Created by Ji.wenjiang on 2016/9/7.
 */


angular.module('inspinia')
  .controller('openFormCtrl', function ($scope, $timeout, $state, values, users) {
    init();
    function init() {
      $scope.forms=values.formValues;
      $scope.formUrl="/user/hospitalizedCard.html";
      $scope.printShow=true;
    }
    $scope.print=function () {
      window.print();
    }

    // addEventListener(list,'click',funtion(event){
    //   event=EventUtil.getEvent(event);
    //   var target=getTarget(event);
    //   switch (target.id){
    //     case "aa":a_function();
    //       break;
    //     case "bb":b_function();
    //       break;
    //   }
    //
    // })
    $scope.chooseForm=function (e) {
          switch (e){
            case 1:
              return $scope.formUrl="/user/hospitalizedCard.html";
              break;
            case 2:
              return $scope.formUrl="/makingModel/modelForm.html";
              break;
            case 3:
              return $scope.formUrl="/validate/checkoutForm.html";
              break;
            case 4:
              return $scope.formUrl="/validate/validate.html";
              break;
            case 5:
              return $scope.formUrl="/record/radiotherapyRecord.html";
              break;
          }



    }

    $scope.selectForm=function (e) {
      console.log(e)
      // console.log($(this).indexOf());
    }

  })
